package com.xzit.day04.service.impl;

import com.xzit.day04.entity.Emp;
import com.xzit.day04.mapper.EmpMapper;
import com.xzit.day04.mapper.EmpMapperPlus;
import com.xzit.day04.service.EmpServicePlus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EmpServicePlusImpl implements EmpServicePlus {
    @Autowired
    private EmpMapperPlus empMapper;
    @Override
    public int addEmp(Emp emp) {
        return empMapper.insert(emp);
    }

    @Override
    public int deleteEmpById(int id) {
        return empMapper.deleteById(id);
    }

    @Override
    public List<Emp> getAllEmps() {
        return empMapper.selectList(null);
    }
}
